/*
* Nettle Source File.
* Copyright (C) 2013, Nettle (http://nttl.ru/).
*
* This file is part of NettleMath.
*
* History:
* Created by Sergey Serb, l-proger@yandex.ru
*/

#include "NMath.h"
#include <cstdio>
#include <iostream>
#include "nmath/NHalf.h"

using namespace NettleMath;
typedef NVector3<bool> bool3;

int main(){
    NHalf f16;
    f16 = 2.52f;
    f16 = f16 * 3;
    float ftest = f16.toFloat();
    printf("Val = %f\n", ftest);

    half3 hvec(2,3,5);
    std::cout << "half3 size " << sizeof(half3) << std::endl;

	float2 ff;
	ff.yx();



    float3 up(0.0f, 1.0f, 0.0f);
    float3 front(0.0f, 0.0f, 1.0f);
    float3 right = cross(up, front);
    right.xyz() = normalize(right.xyz().set(2).xyz().xyz().xyz().xyz().xyz().xyz());
    right.set(1,2,5);
    right.xyz() = right.zzz();
    bool3 equals = up.isEqual3(right);

    std::cout << "Up: " << NVectorToString(up) << std::endl;
    std::cout << "Front: " << NVectorToString(front) << std::endl;
    std::cout << "Right: " << NVectorToString(right) << std::endl;
    std::cout << "equals: " << NVectorToString(equals) << std::endl;

    getchar();
    return 0;
}